package durak;

import java.util.Random;

import cards.Card;
import cards.Deck;
import cards.DeckShuffler;

public class DurakDefaultDeckShuffler implements DeckShuffler {

	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	public void shuffle(Deck deck) {
		Random generator = new Random();

		int shufflesNum = 20; // generator.nextInt();

		for (int i = 0; i < shufflesNum; ++i) {
			for (int j = 0; j < deck.size(); ++j) {
				Card card = deck.getCard(j);
				int newPosition = generator.nextInt(deck.size());
				deck.putCard(card, newPosition);

			}
			
		}
		
		System.out.println("after steps: " + shufflesNum + " \n " + deck.toString());
	}

}
